<?php
declare (strict_types=1);

namespace app\api\controller\deploy;

use app\admin\model\order\Order;
use app\api\controller\Base;
use app\common\service\deploy\RechargeList;
use app\common\service\deploy\RechargeService;
use think\Request;

class Recharge extends Base
{
    /**
     * Author:Yingbo Sun
     * 充值金额列表
     * @return mixed
     * @throws \Psr\SimpleCache\InvalidArgumentException
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function rechargeList()
    {
        $data = RechargeList::rechargeList();
        return $this->res($data);
    }

    /**
     * 充值支付接口
     */
    public function pay()
    {
        $post = request()->post();
        $post['user_id'] = $this->request->uid;
        $data = RechargeService::pay($post);
        return $this->res($data);
    }
}
